<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.active {
				color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
        <ul>
            <li :class="{'active':index1==index}" v-for="(m,index) in movies"><button @click="btnclick(index)">{{index}}-{{m}}</button></li>
        </ul>
    </div>

    <script type="text/javascript">
        const app = new Vue({
            el: '#app',
            data: {
                index1:-1,
                movies:['海湾','东临','沧海','水系']
            },
            methods: {
                btnclick: function(index){
                this.index1 = index;

            }
            }

        });
    </script>
	</body>
</html>
